/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package head.first.design.pattern;

/**
 *
 * @author WangShuai
 */
public class Demo1 {
    public static void main(String[] args) {
        Duck mallardDuck = new MallardDuck();
        mallardDuck.fly();
        mallardDuck.swim();
        mallardDuck.quack();
        FlyBehavior noFly = new FlyNoWay();
        mallardDuck.setFlyBehavior(noFly);
        mallardDuck.fly();
    }
}
